import { NativeModules } from 'react-native';

type AndroidSettingsType = {
  createNotificationChannel(config: Object): void;
  isNotificationEnabled(): Promise<boolean>;
  setInputSoftMode(mode: number): Promise<string>;
  IMPORTANCE_NONE: number;
  IMPORTANCE_MIN: number;
  IMPORTANCE_LOW: number;
  IMPORTANCE_DEFAULT: number;
  IMPORTANCE_HIGH: number;
  ADJUST_RESIZE: number;
  ADJUST_PAN: number;
};

type IosSettingsType = {
  isNotificationAllow(): Promise<boolean>;
  openSettings(): void;
};

const { ANDROIDSettings, IOSSettings } = NativeModules;

const AndroidSettings = ANDROIDSettings as AndroidSettingsType;
const IosSettings = IOSSettings as IosSettingsType;

export { AndroidSettings, IosSettings };
